package cn.px.zly.app.module.brewery.vo;

import cn.px.core.util.BeanUtil;
import cn.px.zly.module.brewery.dto.BreweryDTO;
import cn.px.zly.module.brewery.entity.BreweryPO;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.io.Serializable;

/**
 * @author 品讯科技
 * @date 2024-08
 */
@Data
@ApiModel("酿酒厂vo")
public class BreweryVO implements Serializable {
    @ApiModelProperty("酿酒厂id")
    private Long breweryId;
    @ApiModelProperty("酿酒厂名")
    private String name;
    @ApiModelProperty("封面图")
    private String coverImg;
    @ApiModelProperty("简介")
    private String introduce;
//    @ApiModelProperty("城市id")
//    private Long districtId;
    @ApiModelProperty("厂址")
    private String place;
    @ApiModelProperty("log图")
    private String logImg;
    @ApiModelProperty("log图主色")
    private String bgColor;


    public static BreweryVO valueOf(BreweryDTO dto){
        BreweryVO vo = new BreweryVO();
        BeanUtil.copyBean(dto,vo);
        vo.setBreweryId(dto.getId());
        return vo;
    }
    public static BreweryVO valueOf(BreweryPO po){
        BreweryVO vo = new BreweryVO();
        BeanUtil.copyBean(po,vo);
        vo.setBreweryId(po.getId());
        vo.setPlace(po.getPlace());
        vo.setLogImg(po.getLogoImg());
        return vo;
    }
}
